package On_class.L0408;

import java.io.*;

public class FileReaderWriterTest {
    public static void main(String[] args) throws IOException {
        FileReader fr=null;
        FileWriter fw=null;
        try {
            fr=new FileReader("copy.rar");
            fw=new FileWriter("D:\\copy1.rar");
            int len=0;
            char[] ch=new char[4];
            while((len=fr.read(ch))!=-1){
                fw.write(ch,0,len);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }finally {
            if (fw!=null){
                fw.close();
            }
            if (fr!=null){
                fw.close();
            }
        }
    }
}
